home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / midiamp3 / sample2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-07-21  |  13.0 KB  |  444 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
  3. Object = "{F9F138BB-2119-11D2-9F09-444553540000}#2.0#0"; "MAQMIDIA302.OCX"
  4. Begin VB.Form Form1 
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "Maquisistem Midia - MP3 - OCX 3.0 Beta "
  7.    ClientHeight    =   5820
  8.    ClientLeft      =   45
  9.    ClientTop       =   615
  10.    ClientWidth     =   9960
  11.    Icon            =   "Sample2.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   5820
  14.    ScaleWidth      =   9960
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin MaqMidia30.MaqMidia MaqMidia1 
  17.       Height          =   495
  18.       Left            =   120
  19.       TabIndex        =   25
  20.       Top             =   0
  21.       Width           =   7575
  22.       _ExtentX        =   13361
  23.       _ExtentY        =   873
  24.    End
  25.    Begin ComctlLib.Slider Slider2 
  26.       Height          =   375
  27.       Left            =   4080
  28.       TabIndex        =   22
  29.       Top             =   5280
  30.       Width           =   1935
  31.       _ExtentX        =   3413
  32.       _ExtentY        =   661
  33.       _Version        =   327682
  34.       Max             =   12
  35.    End
  36.    Begin ComctlLib.Slider Slider1 
  37.       Height          =   375
  38.       Left            =   840
  39.       TabIndex        =   21
  40.       Top             =   5280
  41.       Width           =   1935
  42.       _ExtentX        =   3413
  43.       _ExtentY        =   661
  44.       _Version        =   327682
  45.       Max             =   12
  46.    End
  47.    Begin VB.CommandButton Command7 
  48.       Caption         =   "+"
  49.       BeginProperty Font 
  50.          Name            =   "MS Sans Serif"
  51.          Size            =   12
  52.          Charset         =   0
  53.          Weight          =   700
  54.          Underline       =   0   'False
  55.          Italic          =   0   'False
  56.          Strikethrough   =   0   'False
  57.       EndProperty
  58.       Height          =   255
  59.       Left            =   840
  60.       TabIndex        =   20
  61.       Top             =   4680
  62.       Width           =   495
  63.    End
  64.    Begin VB.CommandButton Command6 
  65.       Caption         =   "-"
  66.       BeginProperty Font 
  67.          Name            =   "MS Sans Serif"
  68.          Size            =   13.5
  69.          Charset         =   0
  70.          Weight          =   700
  71.          Underline       =   0   'False
  72.          Italic          =   0   'False
  73.          Strikethrough   =   0   'False
  74.       EndProperty
  75.       Height          =   255
  76.       Left            =   120
  77.       TabIndex        =   19
  78.       Top             =   4680
  79.       Width           =   495
  80.    End
  81.    Begin VB.CommandButton Command3 
  82.       Caption         =   "Delete the last entry"
  83.       Height          =   495
  84.       Left            =   6480
  85.       TabIndex        =   18
  86.       Top             =   4680
  87.       Width           =   1455
  88.    End
  89.    Begin VB.CommandButton Command5 
  90.       Caption         =   "Previous playback"
  91.       Height          =   495
  92.       Left            =   3240
  93.       TabIndex        =   15
  94.       Top             =   4680
  95.       Width           =   1575
  96.    End
  97.    Begin VB.CommandButton Command4 
  98.       Caption         =   "Clean the selection"
  99.       Height          =   495
  100.       Left            =   4920
  101.       TabIndex        =   12
  102.       Top             =   4680
  103.       Width           =   1455
  104.    End
  105.    Begin VB.CommandButton Command2 
  106.       Caption         =   "Next playback"
  107.       Height          =   495
  108.       Left            =   6480
  109.       TabIndex        =   11
  110.       Top             =   4080
  111.       Width           =   1455
  112.    End
  113.    Begin VB.CommandButton Command1 
  114.       Caption         =   "Stop the execution"
  115.       Height          =   495
  116.       Left            =   4920
  117.       TabIndex        =   10
  118.       Top             =   4080
  119.       Width           =   1455
  120.    End
  121.    Begin VB.CommandButton Command11 
  122.       Caption         =   "Play the selection"
  123.       Height          =   495
  124.       Left            =   3240
  125.       TabIndex        =   9
  126.       Top             =   4080
  127.       Width           =   1575
  128.    End
  129.    Begin VB.ListBox List1 
  130.       Height          =   1620
  131.       Left            =   120
  132.       TabIndex        =   8
  133.       ToolTipText     =   "Here will apear your selection"
  134.       Top             =   2280
  135.       Width           =   7575
  136.    End
  137.    Begin VB.DriveListBox Drive1 
  138.       Height          =   315
  139.       Left            =   120
  140.       TabIndex        =   7
  141.       ToolTipText     =   "Select the drive"
  142.       Top             =   600
  143.       Width           =   1815
  144.    End
  145.    Begin VB.DirListBox Dir1 
  146.       Height          =   1215
  147.       Left            =   120
  148.       TabIndex        =   6
  149.       ToolTipText     =   "Select the directory where you can find your media files"
  150.       Top             =   960
  151.       Width           =   1815
  152.    End
  153.    Begin VB.FileListBox File1 
  154.       Height          =   1650
  155.       Left            =   2040
  156.       Pattern         =   "*.mp3;*.mpg;*.wav;*.mpa;*.mid"
  157.       System          =   -1  'True
  158.       TabIndex        =   5
  159.       ToolTipText     =   "Click in the file to add it to the selection box"
  160.       Top             =   600
  161.       Width           =   5655
  162.    End
  163.    Begin VB.CommandButton Command10 
  164.       Caption         =   "Normal speed"
  165.       Height          =   255
  166.       Left            =   1440
  167.       TabIndex        =   4
  168.       Top             =   4680
  169.       Width           =   1455
  170.    End
  171.    Begin ComctlLib.Slider Slider5 
  172.       Height          =   495
  173.       Left            =   1320
  174.       TabIndex        =   0
  175.       Top             =   4080
  176.       Width           =   1695
  177.       _ExtentX        =   2990
  178.       _ExtentY        =   873
  179.       _Version        =   327682
  180.    End
  181.    Begin VB.Label Label6 
  182.       Caption         =   "Master"
  183.       Height          =   255
  184.       Left            =   3240
  185.       TabIndex        =   24
  186.       Top             =   5280
  187.       Width           =   735
  188.    End
  189.    Begin VB.Label Label5 
  190.       Caption         =   "Wave"
  191.       Height          =   255
  192.       Left            =   240
  193.       TabIndex        =   23
  194.       Top             =   5280
  195.       Width           =   615
  196.    End
  197.    Begin VB.Label Label4 
  198.       BeginProperty Font 
  199.          Name            =   "MS Sans Serif"
  200.          Size            =   12
  201.          Charset         =   0
  202.          Weight          =   700
  203.          Underline       =   0   'False
  204.          Italic          =   0   'False
  205.          Strikethrough   =   0   'False
  206.       EndProperty
  207.       ForeColor       =   &H00800000&
  208.       Height          =   375
  209.       Left            =   8640
  210.       TabIndex        =   17
  211.       Top             =   1080
  212.       Width           =   1095
  213.    End
  214.    Begin VB.Label Label3 
  215.       Caption         =   "Position"
  216.       ForeColor       =   &H00008000&
  217.       Height          =   255
  218.       Left            =   7800
  219.       TabIndex        =   16
  220.       Top             =   1080
  221.       Width           =   615
  222.    End
  223.    Begin VB.Label Label2 
  224.       Caption         =   "Files selecteds :"
  225.       ForeColor       =   &H00004080&
  226.       Height          =   255
  227.       Left            =   7800
  228.       TabIndex        =   14
  229.       Top             =   2280
  230.       Width           =   1095
  231.    End
  232.    Begin VB.Label Label1 
  233.       Caption         =   "0"
  234.       ForeColor       =   &H00004080&
  235.       Height          =   255
  236.       Left            =   9000
  237.       TabIndex        =   13
  238.       Top             =   2280
  239.       Width           =   615
  240.    End
  241.    Begin VB.Label Label9 
  242.       BeginProperty Font 
  243.          Name            =   "MS Sans Serif"
  244.          Size            =   12
  245.          Charset         =   0
  246.          Weight          =   700
  247.          Underline       =   0   'False
  248.          Italic          =   0   'False
  249.          Strikethrough   =   0   'False
  250.       EndProperty
  251.       ForeColor       =   &H00800000&
  252.       Height          =   375
  253.       Left            =   8640
  254.       TabIndex        =   3
  255.       Top             =   600
  256.       Width           =   1095
  257.    End
  258.    Begin VB.Label Label8 
  259.       Caption         =   "Length"
  260.       ForeColor       =   &H00008000&
  261.       Height          =   255
  262.       Left            =   7800
  263.       TabIndex        =   2
  264.       Top             =   600
  265.       Width           =   615
  266.    End
  267.    Begin VB.Label Label7 
  268.       Caption         =   "Playback Speed"
  269.       Height          =   255
  270.       Left            =   120
  271.       TabIndex        =   1
  272.       ToolTipText     =   "Click here to default speed"
  273.       Top             =   4200
  274.       Width           =   1335
  275.    End
  276.    Begin VB.Menu about 
  277.       Caption         =   "About"
  278.    End
  279.    Begin VB.Menu hlp 
  280.       Caption         =   "Help"
  281.    End
  282. Attribute VB_Name = "Form1"
  283. Attribute VB_GlobalNameSpace = False
  284. Attribute VB_Creatable = False
  285. Attribute VB_PredeclaredId = True
  286. Attribute VB_Exposed = False
  287. Public Myposition
  288. Public tocar As Boolean
  289. Public pular As Boolean
  290. Public espera As Boolean
  291. Private Sub about_Click()
  292. MaqMidia1.AboutBox
  293. End Sub
  294. Private Sub Command1_Click()
  295. tocar = False
  296. MaqMidia1.StopMidia
  297. End Sub
  298. Private Sub Command10_Click()
  299. Slider5.Value = 25
  300. End Sub
  301. Private Sub Command11_Click()
  302. If List1.ListCount = 0 Then Exit Sub
  303. tocar = True
  304. List1.ListIndex = -1
  305. List1.ListIndex = 0
  306. End Sub
  307. Private Sub Command16_Click()
  308. MaqMidia1.PauseMidia
  309. End Sub
  310. Private Sub Command17_Click()
  311. If Command17.Caption = "Hide" Then
  312. Command17.Caption = "Show"
  313. MaqMidia1.Visible = False
  314. Command17.Caption = "Hide"
  315. MaqMidia1.Visible = True
  316. End If
  317. End Sub
  318. Private Sub Command2_Click()
  319. If List1.ListCount = 0 Then Exit Sub
  320. If (List1.ListCount - 1) = List1.ListIndex Then Exit Sub
  321. List1.ListIndex = List1.ListIndex + 1
  322. End Sub
  323. Private Sub Command3_Click()
  324. If List1.ListCount = 0 Then
  325. Label1.Caption = List1.ListCount
  326. Exit Sub
  327. End If
  328. List1.RemoveItem (List1.ListCount - 1)
  329. Label1.Caption = List1.ListCount
  330. End Sub
  331. Private Sub Command4_Click()
  332. List1.Clear
  333. End Sub
  334. Private Sub Command5_Click()
  335. If List1.ListIndex = -1 Then Exit Sub
  336. If List1.ListCount = 0 Then Exit Sub
  337. List1.ListIndex = List1.ListIndex - 1
  338. End Sub
  339. Private Sub Command6_Click()
  340. Slider5.Value = Slider5.Value - 1
  341. End Sub
  342. Private Sub Command7_Click()
  343. Slider5.Value = Slider5.Value + 1
  344. End Sub
  345. Private Sub Command8_Click()
  346. End Sub
  347. Private Sub Dir1_Change()
  348. File1.Path = Dir1.Path
  349. End Sub
  350. Private Sub Drive1_Change()
  351. Dir1.Path = Drive1.Drive
  352. End Sub
  353. Private Sub File1_Click()
  354. List1.AddItem Dir1.Path & "\" & File1.filename
  355. Label1.Caption = List1.ListCount
  356. End Sub
  357. Private Sub Form_Activate()
  358. MaqMidia1.InitializeMixer
  359. End Sub
  360. Private Sub Form_Load()
  361. Slider5.Min = 0
  362. Slider5.Max = 50
  363. Slider5.Value = 25
  364. End Sub
  365. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  366. MaqMidia1.StopMidia
  367. End Sub
  368. Private Sub Form_Resize()
  369. DoEvents
  370. End Sub
  371. Private Sub Form_Terminate()
  372. MaqMidia1.StopMidia
  373. End Sub
  374. Private Sub Form_Unload(Cancel As Integer)
  375. MaqMidia1.StopMidia
  376. End Sub
  377. Private Sub hlp_Click()
  378. Dim retval
  379. retval = Shell("Winhlp32 MAQMID302.HLP", 1)
  380. End Sub
  381. Private Sub List1_Click()
  382. espera = False
  383. If tocar = False Then Exit Sub
  384. pular = True
  385. MaqMidia1.Midiafile List1.Text, False, True
  386. pular = False
  387. End Sub
  388. Private Sub List1_DblClick()
  389. espera = False
  390. pular = True
  391. MaqMidia1.Midiafile List1.Text, False, True
  392. pular = False
  393. End Sub
  394. Private Sub MaqMidia1_DblClick()
  395. MsgBox "double click"
  396. End Sub
  397. Private Sub MaqMidia1_Finished()
  398. If tocar = False Then Exit Sub
  399. If pular = True Then Exit Sub
  400. If (List1.ListCount - 1) <> List1.ListIndex Then
  401. List1.ListIndex = List1.ListIndex + 1
  402. MaqMidia1.StopMidia
  403. End If
  404. End Sub
  405. Private Sub MaqMidia1_MidiaLength(Length As String)
  406. espera = True
  407. Label9.Caption = Length
  408. If (List1.ListCount - 1) = List1.ListIndex Then Exit Sub
  409. If Length = "00:00" Then
  410. List1.ListIndex = List1.ListIndex + 1
  411. End If
  412. End Sub
  413. Private Sub MaqMidia1_MidiaPosition(Length As String)
  414. espera = True
  415. Label4.Caption = Length
  416. End Sub
  417. Private Sub MaqMidia1_PositionChanged(Position As Long)
  418. Myposition = Position
  419. End Sub
  420. Private Sub Slider5_Change()
  421. MaqMidia1.MidiaSpeed (Slider5.Value * 40)
  422. End Sub
  423. Private Sub Slider5_scroll()
  424. MaqMidia1.MidiaSpeed (Slider5.Value * 40)
  425. End Sub
  426. Private Sub Slider1_Scroll()
  427. MaqMidia1.WaveMovieVolumeSet Slider1.Value, Slider1.Value
  428. End Sub
  429. Private Sub MaqMidia1_waveMovieVolumeRefresh(LeftVolume As Long, RightVolume As Long)
  430. If LeftVolume <> RightVolume Then
  431. Slider1.Value = ((LeftVolume + RightVolume) / 2) ' if you have two sliders to rigth or left channel then set any channel to the repective output
  432. Slider1.Value = LeftVolume
  433. End If
  434. End Sub
  435. Private Sub Slider2_Scroll()
  436. MaqMidia1.MasterVolumeSet Slider2.Value, Slider2.Value
  437. End Sub
  438. Private Sub MaqMidia1_MasterVolumeRefresh(LeftVolume As Long, RightVolume As Long)
  439. If LeftVolume <> RightVolume Then
  440. Slider2.Value = ((LeftVolume + RightVolume) / 2) ' if you have two sliders to rigth or left channel then set any channel to the repective output
  441. Slider2.Value = LeftVolume
  442. End If
  443. End Sub
  444.